package com.dog.basics.common.util;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author hangdy
 * @description: TODO
 * @date 2020/11/13 19:20
 */
public class CouponCodeUtil {
    private static AtomicInteger counter = new AtomicInteger(0);

    /**
     * 长生消息id
     */
    public static long getAtomicCounter() {
        if (counter.get() > 999999) {
            counter.set(1);
        }
        long time = System.currentTimeMillis();
        long returnValue = time * 100 + counter.incrementAndGet();
        return returnValue;
    }
}
